<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台列表(新)</title>
    <link rel="stylesheet" href="${base}/layui/css/layui.css">
    <link rel="stylesheet" href="${base}/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${base}/css/admin.css">
    <style>
    	.layui-bg-black{width: 200px;height: 136px;margin-right: 30px;float: left;text-align: center;font-size: 33px;color: #000000!important;padding-top: 30px;}
    	.hide {display: none;}
    	.checkbox{display: inline-block;}
    	.layui-form-item{font-size: 18px;}
    	.width30 { width: 72px;margin-right: 5px;float: left;text-align: right;}
    	.width180 {width: 160px;margin-right: 5px;float: left;}
    	.layui-select{float: left;}
    </style>
</head>
<body class="layui-layout-body" style="overflow:scroll;">
<#include "/common/left.flt">	
<div class="layui-main" style="position: absolute;left: 205px;top: 20px; width: calc(100% - 210px);" >
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
  <legend>操作提示</legend>
</fieldset>
<div class="layui-form hide" id="discuss" style="padding-top:20px;padding-right:20px;">
  <div class="layui-form-item">
    <label class="layui-form-label">帖子id</label>
    <div class="layui-input-block">
       <input name="card_id" id="card_id" class="layui-input layui-text" />
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">评论内容</label>
    <div class="layui-input-block">
      <input name="content" id="content" placeholder="请输入内容" class="layui-input" />
    </div>
  </div>
</div>

<div class="layui-form hide" id="admin" style="padding-top:20px;padding-right:20px;">
  <div class="layui-form-item">
    <label class="layui-form-label">后台账号</label>
    <div class="layui-input-block">
         <select name="admin_user_id" id="admin_user_id" class="width100 layui-select">
	 			<option value=""></option>
		      	<#list admin_list as one>
		        <option value="${one.id}">${one.user_name}</option>
		        </#list>	
		 </select>
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">开始手机号</label>
    <div class="layui-input-block">
      <input name="mobile" id="mobile" placeholder="请输入手机号" class="layui-input" required="required" type="number" />
    </div>
  </div>
</div>


<blockquote class="layui-elem-quote layui-quote-nm">
 	<form action="${base}/navy_user/new_index" method="post" id="dataForm">
        <div class="layui-input-inline">
        	<label class="layui-form-label">地区负责人</label><select name="person" id="person" class="width100 layui-select">
 				<option value=""></option>
 				<option value="1">袁杰</option>
                <option value="2">李扬</option>
                <option value="3">张炜</option>
                <option value="4">常少彪</option>
                <option value="100">强制清空</option>
		      </select>
		    <label class="layui-form-label">年龄</label><input type="number" class="width30 layui-input" name="minage" value="${minage?default('')}" placeholder="最小值" /><input type="number" class="width30 layui-input" name="maxage" value="${maxage?default('')}" placeholder="最大值" />
		    
		    <label class="layui-form-label">地区</label>
		     <select name="area" id="area"  class="width100 layui-select">
		     	<option value=""></option>
		      	<#list area_list as one>
		        <option value="${one.code}">${one.name}</option>
		        </#list>
		      </select>
  			<label class="layui-form-label">性别:</label><select name="sex" id="sex" class="width100 layui-select">
 				<option value=""></option>
 				<option value="1">男</option>
                <option value="2">女</option>
                <option value="3">CD</option>
                <option value="4">FtM</option>
                <option value="5">MtF</option>
		    </select>
		    <label class="layui-form-label">属性</label><select name="tag_ids" id="tag_ids" class="width100 layui-select">
 				<option value=""></option>
 				<option value="16">Moon</option>
                <option value="25">Star</option>
		      </select>
		    <label class="layui-form-label">发过帖</label><select name="auth_badge" id="auth_badge" class="width100 layui-select">
 				<option value="">否</option>
 				<option value="1">是</option>
		     </select>  
		    <input placeholder="自定义标签" name="zu" class="width180 layui-input" value="${zu?default('')}" />
			<select name="is_true" id="is_true" class="layui-select" >
	             <option value="">不限</option>
	             <option value="2">B类</option>
	             <option value="3">C类</option>
	             <option value="4">D类</option>
	         </select>
		    <input placeholder="手机号" name="user_mobile" class="width180 layui-input" value="${user_mobile?default('')}" />
		    <button class="layui-btn" lay-submit="" style="float: left;"> <span class="fa fa-search"></span>查询</button>
		    <a class="layui-btn" onclick="create();" title="生成50女水军"> <span class="fa fa-users"></span>50水军</a>
        </div>
    </form>
</blockquote> 

<table class="layui-table" >
	<thead>
        <tr>
             <th>编号</th>
             <th>登录名</th>
             <th>昵称</th>
             <th>热度</th>
             <th>性别</th>
             <th>生日</th>
             <th>省份</th>
             <th>添加时间</th>
             <th>会员到期时间</th>
             <th>操作</th>
         </tr>
     </thead>
     <tbody>
     <#list list as one>
     <tr>
     	<td><a href="${base}/users_list/detail?user_id=${one.id}" target="_blank">${one.id}</a></td>
     	<td>${one.user_mobile?default('')}</td>
     	<td>${one.nick_name?default('')}</td>
     	<td>${one.hot_val?default('')}</td>
     	<td>${one.sex_name?default('')}</td>
     	<td>${one.birthday_string?default('')}</td>
     	<td>${one.area_name?default('')}</td>
     	<td>${one.create_time_string?default('')} </td>
     	<td><#if one.vip_end_time?? ><#if one.vip_end_time gt 0 >${one.vip_end_time_string?default('')}</#if></#if> </td>
     	<td><a href="${base}/navy_user/add_card?user_id=${one.id}" target="_blank" ><span class="fa fa-paper-plane-o" title="发帖"></span>(${one.auth_badge})</a>
     	<a onclick="discuss(${one.id});" title="评论帖子" target="_blank"><span class="fa fa-comments-o"></span></a> |
     	<a href="${base}/navy_user/discuss_list?user_id=${one.id}" title="帖子评论"  target="_blank"> 评论(${one.num2?default('0')})</a>|
     	<a href="${base}/chat_im?user_id=${one.id}" title="发起聊天"  target="_blank">发起聊天</a>
     	</td>
     </tr>
     </#list>
     </tbody>
</table>
<div id="pageDiv"></div>
<form action="${base}/util/uploadFile" method="post" name="uploadForm" enctype="multipart/form-data" id="uploadForm" class="hide" >
    <input name="pic" type="file" id="pic" class="hide"/>
</form>
</body>
<script src="${base}/js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${base}/layui/layui.all.js"></script>
<script type="text/javascript">
$("#area").val('${area?default('')}');
$("#sex").val('${sex?default('')}');
$("#person").val('${person?default('')}');
$("#tag_ids").val('${tag_ids?default('')}');
$("#is_true").val('${is_true?default('')}');
$("#auth_badge").val('${auth_badge?default('')}');

function create(){
	layer.open({
	    type: 1 ,
	    title: '生成水军配置', 
	    area: ['600px', '400px'],   //宽高
	    shade: 0.4,   //遮罩透明度
	    content: $("#admin"),
	    btn: ['确定'], //按钮组
	    scrollbar: false ,//屏蔽浏览器滚动条
	    yes: function(index){
	    	var admin_user_id = $("#admin_user_id").val();
	    	var mobile = $("#mobile").val();
	    	if (admin_user_id){
	    		$.post("${base}/navy_user/create",
				   		{"admin_user_id":admin_user_id,"mobile":mobile},function(data){ 
				   			layer.alert(data);
				   			$("#admin").hide();
				   		}
				 );	
	    	}
	        layer.close(index);
	        
	        $("#admin").hide();
	    },
		cancel: function(){
			$("#admin").hide();        
	    }
	});
}

function discuss(user_id){
	layer.open({
	    type: 1 ,
	    title: '用户' + user_id +'评论', 
	    area: ['600px', '400px'],   //宽高
	    shade: 0.4,   //遮罩透明度
	    content: $("#discuss"),
	    btn: ['确定'], //按钮组
	    scrollbar: false ,//屏蔽浏览器滚动条
	    yes: function(index){
	    	var card_id = $("#card_id").val();
	    	var content = $("#content").val();
	    	if (content){
	    		$.post("${base}/navy_user/giveDiscuss",
				   		{"card_id":card_id,"user_id":user_id,"content":content,type:0},function(data){ 
				   			layer.alert(data);
				   			$("#discuss").hide();
				   		}
				 );	
	    	}
	        layer.close(index);
	        
	        $("#discuss").hide();
	    },
		cancel: function(){
			$("#discuss").hide();        
	    }
	});
}
</script>
</html>